package com.bupt.godxian.charging.service;

import com.bupt.godxian.charging.entity.WaitArea;

import com.bupt.godxian.charging.mapper.WaitAreaMapper;
import org.springframework.stereotype.Service;

@Service
public class WaitAreaService {

    private final WaitAreaMapper waitAreaMapper;

    public WaitAreaService(WaitAreaMapper waitAreaMapper) {
        this.waitAreaMapper = waitAreaMapper;
    }

    public WaitArea addWaitArea(Long requestId, String type) {
        // 创建等候区对象
        WaitArea waitArea = new WaitArea();
        waitArea.setRequestId(String.valueOf(requestId));
        waitArea.setType(type);

        // 添加等候区的逻辑
        waitAreaMapper.insert(waitArea);

        return waitArea;
    }

    public WaitArea getWaitAreaById(String id) {
        // 根据 ID 查询等候区
        return (WaitArea) waitAreaMapper.selectByPrimaryKey(id);
    }

    // 添加其他需要的方法，如更新等候区、删除等候区等
}
